package codetop.microsoft.T300;

import java.util.Arrays;

/**
 * @Author: 18362
 * @Create: 2022-08-15 14:51:49 星期一
 */
class Solution {
    public int lengthOfLIS(int[] nums) {
        int[] dp = new int[nums.length];
        Arrays.fill(dp, 1);
        int res = 1;
        for (int i=1; i<nums.length; ++i) {
            for (int j=0; j<i; ++j) {
                if (nums[j] < nums[i])
                    dp[i] = Math.max(dp[i], dp[j]+1);
            }
            res = Math.max(res, dp[i]);
        }
        return res;
    }
}